<template>
    <div class="business">
        <Form ref="formData" :model="formData" :label-width="110">
            <Row>
                <!--   <Col :xs="24">
                          <FormItem label="简述原因">
                              <Input :disabled="readOnly || disabled" type="textarea" class="business-textarea"
                                     v-model="formData.remarks"/>
                          </FormItem>
                      </Col>-->
             <!--   <Col :xs="24">
                    <FormItem label="申请资料:" required>
                        <Button type="primary" @click="openUploadModal">申请资料</Button>
                    </FormItem>
                </Col>-->
            </Row>
        </Form>
        <UploadFileModal ref="uploadFileModal" :modal="isUploadFileModalOpen" @closeModal="closeModal"
                         :param="fileParams" :isPreview="isPreview || readOnly"/>
    </div>
</template>

<script>
    import UploadFileModal from "_p/basic/pages/contract/common/uploadFileModal/uploadFileModal";
    export default {
        name: "",
        components: {
            UploadFileModal
        },
        props: {
            readOnly: {
                type: Boolean,
                require: true
            },
            Obj: {
                type: Object,
            },
            isUploadFileModalOpen: {
                type: Boolean,
                require: true
            } ,
            fileParams: {
                type: Object,
                require: true
            }
        },
        data() {
            return {
                disabled: false,
                isPreview: false,
                formData: {
                    reason: "",
                    application: null,
                    caseNo: null,
                    id: null
                }
            };
        },
        mounted() {
            if (this.Obj.processStatus !== undefined && this.Obj.processStatus !== 'draft' && this.Obj.processStatus !== 'toBeRepaired') {
                this.isPreview = true;
                this.disabled = true;
            } else {
                this.isPreview = false;
                this.disabled = false;
            }
        },
        methods: {
            openUploadModal() {
              this.$emit("openUploadModal" );
            },
            closeModal() {
                this.$emit("closeModal");
            },

        }
    }
    ;
</script>

<style lang="less" scoped>
    .business form {
        width: 100%;

        .business-textarea {
            max-width: 100%;
        }
    }
</style>
